package com.learn.multi_thread.A_BaseThread.C_ReentrantLock;

public class SaleTicketsAboutLock {
    /**
     * 继承方式实现售票
     */
    public static void main(String[] args) {
        TicketThreadForThreadAboutLock t1 = new TicketThreadForThreadAboutLock();
        TicketThreadForThreadAboutLock t2 = new TicketThreadForThreadAboutLock();
        TicketThreadForThreadAboutLock t3 = new TicketThreadForThreadAboutLock();

        t1.setName("窗口1");
        t2.setName("窗口2");
        t3.setName("窗口3");

        t1.start();
        t2.start();
        t3.start();
    }

    /**
     * 实现方式实现售票
     *
     */
//    public static void main(String[] args) {
//        TicketThreadForRunnable mr = new TicketThreadForRunnable();
//
//        Thread t1 = new Thread(mr);
//        Thread t2 = new Thread(mr);
//        Thread t3 = new Thread(mr);
//
//        t1.setName("窗口1");
//        t2.setName("窗口2");
//        t3.setName("窗口3");
//
//        t1.start();
//        t2.start();
//        t3.start();
//    }
}

